package ru.tapublog.lib.samsungwallet.impl.dao;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;

@XmlAccessorType(XmlAccessType.FIELD)
public class ViewElement {
	private String id;
	private TextElementData text;
	private ImageDAO image;
	private BarcodeDAO barcode;

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ViewElement other = (ViewElement) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public TextElementData getText() {
		return text;
	}

	public void setText(TextElementData text) {
		this.text = text;
	}

	public ImageDAO getImage() {
		return image;
	}

	public void setImage(ImageDAO image) {
		this.image = image;
	}

	public BarcodeDAO getBarcode() {
		return barcode;
	}

	public void setBarcode(BarcodeDAO barcode) {
		this.barcode = barcode;
	}

	@Override
	public String toString() {
		return "ViewElement [id=" + id + ", text=" + text + ", image=" + image
				+ ", barcode=" + barcode + "]";
	}
}
